home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <conio.h>
- #include <graphics.h>
- main()
- {
- int graphdriver=DETECT, graphmode, numcolors;
- struct palettetype *p_pal;
- /* Detect and initialize the graphics system */
- initgraph(&graphdriver, &graphmode, "c:\\turboc");
- /* Display the default palette of the current graphics driver */
- p_pal = getdefaultpalette();
- numcolors = p_pal->size;
- printf("The %s driver's default palette in %s mode has %d colors \n",
- getdrivername(), getmodename(graphmode), numcolors);
-
- /* Wait for a keystroke before exiting */
- getch();
- closegraph();
- }